package com.awcall.iot.controller;


import com.awcall.iot.common.BaseController;
import com.awcall.iot.common.ResponseResult;
import com.awcall.iot.model.OperateLog;
import com.awcall.iot.model.Statements;
import com.awcall.iot.service.IOperateLogService;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 操作日志表 前端控制器
 * </p>
 *
 * @author wuhui
 * @since 2018-03-05
 */
@RestController
@RequestMapping("/admin/operateLog")
public class OperateLogController extends BaseController {

    @Autowired
    private IOperateLogService iOperateLogService;

    @GetMapping("/index")
    public ResponseResult index(Statements statements, Page<OperateLog> page) {
        EntityWrapper<OperateLog> entityWrapper = new EntityWrapper<>();
        entityWrapper.eq("statements_id", statements.getStatementsId());
        Page<OperateLog> operateLogPage = iOperateLogService.selectPage(page, entityWrapper);
        return new ResponseResult<>(operateLogPage);
    }

}
